import React,{useRef} from 'react'

export default function App() {
  let searchInput=useRef()
  return (
    <div>
      <input ref={searchInput} placeholder='请输入搜索关键字'></input>
      <button onClick={()=>console.log(searchInput.current.value)}>搜索</button>
    </div>
  )
}
